//---------------------------------------------------------------------------

#ifndef CIISMainH
#define CIISMainH
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include "CIISDB.h"
#include "DebugWinU.h"
#include "CIISNetInterface.h"
#include "CIISServerInterface.h"
#include "CIISClientInterface.h"
#include <Buttons.hpp>
#include <ExtCtrls.hpp>
#include <ScktComp.hpp>
#include <ComCtrls.hpp>
#include <Mask.hpp>

#define Startmode 0

// 0 : LocalServer ( Logger )
// 1 : RemoteServer ( User )
// 2 : LocalServer + DebugWin
// 3 : RemoteServer + DebugWin
// 4 : Local/Remote selectable

//---------------------------------------------------------------------------
class TCIISMainFrm : public TForm
{
__published:	// IDE-managed Components
        TBitBtn *BBReset;
        TTimer *TimerSysCheck;
        TRadioGroup *RGServerMode;
        TGroupBox *GBPort;
        TMaskEdit *MEdLServerPortNo;
        TLabel *LServerPortNo;
        TLabel *RServerPortNo;
        TUpDown *UpDownLServerPortNo;
        TGroupBox *CBAlias;
        TEdit *EdAlias;
        TBitBtn *BBDebugWin;
	TButton *BQSetUp1;
        TMaskEdit *MEdRServerPortNo;
        TUpDown *UpDownRServerPortNo;
        TGroupBox *GBLocalIP;
        TEdit *EdLocalIP;
        TLabel *LServerPortNoPM;
        TMaskEdit *MEdLServerPortNoPM;
        TUpDown *UpDownLServerPortNoPM;
	TButton *BQSetUp2;
	TGroupBox *GroupBox1;
	TLabel *LClientPortNo;
	TMaskEdit *MEdClientPortNo;
	TUpDown *UpDownClientPortNo;
	TGroupBox *GBServerPortsConnected;
	TLabel *LCIIPM;
	TLabel *LCIIMonitor;
	TLabel *LCIIUser;
	TGroupBox *GBClientPorts;
	TLabel *LCIILogger;
	TGroupBox *GBCamurIILogger;
	TLabel *LCIIBusInt;
	TLabel *LNodes;
	TLabel *LNoOfNodes;
	TLabel *LNoOfBusInt;
	TGroupBox *GBRecordings;
	TLabel *LNoOfMonitors;
	TLabel *LMonitors;
	TLabel *LNoOfDecays;
	TLabel *LDecays;
	TLabel *NoOfLPRs;
	TLabel *LLPRs;
	TShape *ShPMConnected;
	TShape *ShMonitorConnected;
	TShape *ShUserConnected;
	TShape *ShLoggerConnected;
        void __fastcall FormCreate(TObject *Sender);
        void __fastcall FormDestroy(TObject *Sender);
        void __fastcall BBResetClick(TObject *Sender);
        void __fastcall TimerSysCheckTimer(TObject *Sender);
        void __fastcall ChangeDebugState(int State);
        void __fastcall RGServerModeClick(TObject *Sender);
        void __fastcall BBDebugWinClick(TObject *Sender);
        void __fastcall BQSetUp1Click(TObject *Sender);
        void __fastcall FormShow(TObject *Sender);
	void __fastcall BQSetUp2Click(TObject *Sender);
private:	// User declarations
  TDebugWin *DebWin;
  TCIISDBModule *DB;
  TCIISNetInterface *NetInt;
  TCIISServerInterface *SerInt;
  TCIISClientInterface *ClientInt;
  CIISServerMode ServerMode;
  bool StartDebugWin, InitFaild;
  TDateTime TSync;
  

        void __fastcall Debug(String Message);
public:		// User declarations
        __fastcall TCIISMainFrm(TComponent* Owner);
        
};
//---------------------------------------------------------------------------
extern PACKAGE TCIISMainFrm *CIISMainFrm;
//---------------------------------------------------------------------------
#endif


